/*
 * @Author: aum
 * @Date: 2021-03-05 16:25:52
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-08-29 23:24:09
 * @Description: 基础路由
 * @FilePath: \vue3-hand-vant\src\router\common.ts
 */

import { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/tool'
  },
  {
    path: '/tool',
    component: () => import(/* webpackChunkName: "tool" */ '@/views/tool/index.vue'),
    redirect: '/tool/home',
    children: [
      {
        path: 'home',
        component: () => import(/* webpackChunkName: "tool" */ '@/views/tool/home/index.vue'),
        meta: { title: '首页', requiresAuth: true }
      },
      {
        path: 'login',
        component: () => import(/* webpackChunkName: "tool" */ '@/views/tool/login/index.vue'),
        meta: { title: '开发者登录', requiresAuth: false }
      }
    ]
  },
  {
    path: '/:catchAll(.*)*',
    name: 'NotFound',
    component: () => import(/* webpackChunkName: "tool" */ '@/views/tool/404.vue')
  }
]

export default routes
